<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link href="/css/adminMenu.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" language="javascript" src="/js/jquery-1.6.1.min.js"></script>
	<script type="text/javascript" language="javascript" src="/js/tool.js"></script>
	<title>琥珀川 - 内存管理</title>
</head>

<body>
	<jsp:include page="/admin/include/menu" flush="true"/>
	<div class="mainDiv">
		<div>
			内存池使用时间：<font title="${memoryPond.createTime}">${memoryPond.createTimeString}</font><br/>
			<A href="javascript:clickResetMemoryPond()">[重置内存池]</A><br/>
			<A href="javascript:clickResetUpdatePage()">[重置修改的静态页面]</A><br/>
			<A href="javascript:clickResetAllPage()">[重置全部的静态页面]</A><br/>
		</div>
		<%--内存中的地区分类列表--%>
		<div style="margin-top:20px;">
			地区分类列表长度：${fn:length(memoryPond.areaSortList)}
		</div>
		<div>
			<table border="1">
				<tr>
					<c:forEach items="${memoryPond.areaSortList}" var="aAreaSort">
						<td>
							<div>${aAreaSort.id}</div>
							<div>${aAreaSort.name}</div>
							<div>${aAreaSort.weight}</div>
						</td>
					</c:forEach>
				</tr>
			</table>
		</div>
		
		<%--内存中的类型列表--%>
		<div style="margin-top:20px;">
			类型列表长度：${fn:length(memoryPond.typeList)}
		</div>
		<div>
			<table border="1">
				<tr>
					<c:forEach items="${memoryPond.typeList}" var="aType">
						<td>
							<div>${aType.id}</div>
							<div>${aType.name}</div>
							<div>${aType.weight}</div>
						</td>
					</c:forEach>
				</tr>
			</table>
		</div>
		
		<%--内存中的年份列表--%>
		<div style="margin-top:20px;">
			年份列表长度：${fn:length(memoryPond.yearList)}
		</div>
		<div>
			<table border="1">
				<tr>
					<c:forEach items="${memoryPond.yearList}" var="aYear">
						<td>
							<div>${aYear.id}</div>
							<div>${aYear.name}</div>
							<div>${aYear.startDate}</div>
							<div>${aYear.endDate}</div>
							<div>${aYear.weight}</div>
						</td>
					</c:forEach>
				</tr>
			</table>
		</div>
		
		<%--内存中的导演列表--%>
		<div style="margin-top:20px;">
			导演列表长度：${fn:length(memoryPond.directorListHashList)}
		</div>
		<div>
			<table border="1">
				<tr>
					<c:forEach items="${memoryPond.directorListHashList}" var="aDirectorListHash">
						<td>
							<div>${aDirectorListHash.key}</div>
							<div>
								<table border="1">
									<c:forEach items="${aDirectorListHash.value}" var="aDirector">
										<tr>
											<td>${aDirector.id}</td>
											<td>
												<font style="white-space:nowrap;">${aDirector.name}</font>
											</td>
										</tr>
									</c:forEach>
								</table>
							</div>
						</td>
					</c:forEach>
				</tr>
			</table>
		</div>
		
		<%--内存中的演员列表--%>
		<div style="margin-top:20px;">
			演员列表长度：${fn:length(memoryPond.actorListHashList)}
		</div>
		<div>
			<table border="1">
				<tr>
					<c:forEach items="${memoryPond.actorListHashList}" var="aActorListHash">
						<td>
							<div>${aActorListHash.key}</div>
							<div>
								<table border="1">
									<c:forEach items="${aActorListHash.value}" var="aActor">
										<tr>
											<td>${aActor.id}</td>
											<td>
												<font style="white-space:nowrap;">${aActor.name}</font>
											</td>
										</tr>
									</c:forEach>
								</table>
							</div>
						</td>
					</c:forEach>
				</tr>
			</table>
		</div>
		
		<%--内存中的本周最热列表--%>
		<div style="margin-top:20px;">
			本周最热列表长度：${fn:length(memoryPond.tswkList)}
		</div>
		<div>
			<table border="1">
				<tr>
					<c:forEach items="${memoryPond.tswkList}" var="aTswk">
						<td>
							<div>${aTswk.id}</div>
							<div>
								<font style="white-space:nowrap;">${aTswk.name}</font>
							</div>
						</td>
					</c:forEach>
				</tr>
			</table>
		</div>
		
		<%--内存中的友情链接列表--%>
		<div style="margin-top:20px;">
			友情链接列表长度：${fn:length(memoryPond.friendLinkList)}
		</div>
		<div>
			<table border="1">
				<tr>
					<c:forEach items="${memoryPond.friendLinkList}" var="aFriendLink">
						<td>
							<div>${aFriendLink.id}</div>
							<div>${aFriendLink.name}</div>
							<div>${aFriendLink.description}</div>
							<div>
								<A href="${aFriendLink.url}" style="white-space:nowrap;" target="_blank">${aFriendLink.url}</A>
							</div>
							<div>${aFriendLink.weight}</div>	
						</td>
					</c:forEach>
				</tr>
			</table>
		</div>
		
		<%--内存中的电影列表页面--%>
		<div style="margin-top:20px;">
			电影列表页面长度：${fn:length(memoryPond.pageMovieListHashList)}
		</div>
		<div>
			<table border="1">
				<tr>
					<c:forEach items="${memoryPond.pageMovieListHashList}" var="aPageMovieListHash">
						<td>
							<div>${aPageMovieListHash.key}</div>
							
							<c:set var="aPageMovieList" value="${aPageMovieListHash.value}"/>
							
							<div>${aPageMovieList.id}</div>
							<div>
								<A href="/movieList/y${aPageMovieList.yearId}/s${aPageMovieList.areaSortId}/t${aPageMovieList.typeId}/d${aPageMovieList.directorId}/a${aPageMovieList.actorId}/p${aPageMovieList.pageNo}"
									title="/movieList/y${aPageMovieList.yearId}/s${aPageMovieList.areaSortId}/t${aPageMovieList.typeId}/d${aPageMovieList.directorId}/a${aPageMovieList.actorId}/p${aPageMovieList.pageNo}" 
									style="white-space:nowrap;" target="_blank"
								>${aPageMovieList.url}</A>
							</div>
							<div>${aPageMovieList.isUpdate}</div>
							<div>${aPageMovieList.createTime}</div>
							<div>${aPageMovieList.updateTime}</div>
						</td>
					</c:forEach>
				</tr>
			</table>
		</div>
		
		<%--内存中的电影页面--%>
		<div style="margin-top:20px;">
			电影页面长度：${fn:length(memoryPond.pageMovieHashList)}
		</div>
		<div>
			<table border="1">
				<tr>
					<c:forEach items="${memoryPond.pageMovieHashList}" var="aPageMovieHash">
						<td>
							<div>${aPageMovieHash.key}</div>
							
							<c:set var="aPageMovie" value="${aPageMovieHash.value}"/>
							
							<div>${aPageMovie.id}</div>
							<div>
								<A href="/movie/${aPageMovie.movieId}"
									title="/movie/${aPageMovie.movieId}" 
									style="white-space:nowrap;" target="_blank"
								>${aPageMovie.url}</A>
							</div>
							<div>${aPageMovie.isUpdate}</div>
							<div>${aPageMovie.createTime}</div>
							<div>${aPageMovie.updateTime}</div>
						</td>
					</c:forEach>
				</tr>
			</table>
		</div>
		
		<%--内存中的播放--%>
		<div style="margin-top:20px;">
			播放长度：${fn:length(memoryPond.playHashList)}
		</div>
		<div>
			<table border="1">
				<tr>
					<c:forEach items="${memoryPond.playHashList}" var="aPlayHash">
						<td>
							<div>${aPlayHash.key}</div>
							
							<c:set var="aPlay" value="${aPlayHash.value}"/>
							
							<div>${aPlay.id}</div>
							<div>
								<A href="/play/${aPlay.id}"
									title="/play/${aPlay.id}" 
									style="white-space:nowrap;" target="_blank"
								>${aPlay.name}</A>
							</div>
							<div>
								<A href="${aPlay.url}"
									title="${aPlay.url}" 
									style="white-space:nowrap;" target="_blank"
								>${aPlay.url}</A>
							</div>
							<div>${aPlay.playCount}</div>
							<div>${aPlay.createTime}</div>
						</td>
					</c:forEach>
				</tr>
			</table>
		</div>
		
	</div>
</body>
<script type="text/javascript">
	<%--点击重置内存池--%>
	function clickResetMemoryPond(){
		if(confirm("确定重置内存池")){
			tool.ajax({
				requestUrl:"/admin/ajax?action=resetMemoryPond",
				overtimeUrl:"/admin/login",
				dataSet:{},
				success:function(msg){
					if(msg.stateCode == "success"){
						<%--刷新页面--%>
						window.location.reload();
					}
				}
			});
		}
	}
	
	<%--点击重置修改的静态页面--%>
	function clickResetUpdatePage(){
		if(confirm("确定重置修改的静态页面")){
			tool.ajax({
				requestUrl:"/admin/ajax?action=resetUpdatePage",
				overtimeUrl:"/admin/login",
				dataSet:{},
				success:function(msg){
					if(msg.stateCode == "success"){
						alert("这个功能未实现");
						<%--刷新页面--%>
						window.location.reload();
					}
				}
			});
		}
	}
	
	<%--点击重置全部的静态页面--%>
	function clickResetAllPage(){
		if(confirm("确定重置全部的静态页面")){
			tool.ajax({
				requestUrl:"/admin/ajax?action=resetAllPage",
				overtimeUrl:"/admin/login",
				dataSet:{},
				success:function(msg){
					if(msg.stateCode == "success"){
						<%--刷新页面--%>
						window.location.reload();
					}
				}
			});
		}
	}
</script>
</html>
